package cn.wolfcode.luowowo.common.util;

import lombok.Getter;
import lombok.Setter;

@Getter @Setter
public class AjaxResult {
    private boolean success = true;
    private String msg;
    private Object data;
    private int code;

    public AjaxResult(){}
    public AjaxResult(boolean success,String msg){
        this.success = success;
        this.msg = msg;
    }

    public AjaxResult getData(Object data){
        this.setData(data);
        return this;
    }

//    public static AjaxResult SUCCESS(){
//        return new AjaxResult();
//    }
    public static AjaxResult UNLOGIN(){
        AjaxResult unLoginResult = new AjaxResult(false, "请登陆后操作");
        unLoginResult.setCode(102);
        return unLoginResult;
    }
}
